﻿using System.Windows;
using System.Windows.Controls;
using System;

namespace Bridge.UI
{
    /// <summary>
    /// Interaction logic for CustomPopup.xaml
    /// </summary>
    public partial class CustomPopup : Window
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CustomPopup"/> class.
        /// </summary>
        /// <param name="userControl">UserControl to put into the popup.</param>
        public CustomPopup(UserControl userControl)
        {
            if (userControl == null) throw new ArgumentNullException("userControl");

            InitializeComponent();

            gridMain.Children.Add(userControl);
            Height = userControl.Height;
            Width = userControl.Width;
            userControl.Tag = this;
        }
    }
}
